<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增订单列表')" />
    <th:block th:include="include :: datetimepicker-css" />
    <th:block th:include="include :: summernote-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-orderInfo-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">用户id：</label>
                <div class="col-sm-8">
                    <input name="userId" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">通道编码：</label>
                <div class="col-sm-8">
                    <input name="channel" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">支付通道账号：</label>
                <div class="col-sm-8">
                    <input name="channelAccount" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">平台收款账户ID：</label>
                <div class="col-sm-8">
                    <input name="recipientId" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">支付宝authcode：</label>
                <div class="col-sm-8">
                    <input name="aliAuthCode" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">经度：</label>
                <div class="col-sm-8">
                    <input name="longitude" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">维度：</label>
                <div class="col-sm-8">
                    <input name="latitude" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">付款者支付宝ID：</label>
                <div class="col-sm-8">
                    <input name="aliUserId" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">收款号所有者的uid：</label>
                <div class="col-sm-8">
                    <input name="recipientUid" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">收款号实名：</label>
                <div class="col-sm-8">
                    <input name="recipientRealName" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">订单金额：</label>
                <div class="col-sm-8">
                    <input name="money" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">用户实际支付金额。单位分：</label>
                <div class="col-sm-8">
                    <input name="realMoney" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">到账金额。单位分：</label>
                <div class="col-sm-8">
                    <input name="receiptMoney" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">商户自己的唯一订单号：</label>
                <div class="col-sm-8">
                    <input name="outTradeNo" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">商户下单传的附加信息。：</label>
                <div class="col-sm-8">
                    <input name="outBody" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">商户自己用户的id：</label>
                <div class="col-sm-8">
                    <input name="outUserId" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">商品名称：</label>
                <div class="col-sm-8">
                    <input name="goodsName" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">支付成功异步通知地址：</label>
                <div class="col-sm-8">
                    <textarea name="notifyUrl" class="form-control" required></textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">支付成功后跳转的商户url：</label>
                <div class="col-sm-8">
                    <textarea name="returnUrl" class="form-control" required></textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">支付二维码文本：</label>
                <div class="col-sm-8">
                    <textarea name="qrcodeTxt" class="form-control"></textarea>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">二维码图片真正内容：</label>
                <div class="col-sm-8">
                    <input type="hidden" class="form-control" name="qrcodeContent">
                    <div class="summernote" id="qrcodeContent"></div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">支付二维码图片地址：</label>
                <div class="col-sm-8">
                    <textarea name="qrcodeUrl" class="form-control"></textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">支付地址：</label>
                <div class="col-sm-8">
                    <textarea name="payUrl" class="form-control"></textarea>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">二维码生成时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="qrcodeTime" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">是否支付成功：</label>
                <div class="col-sm-8">
                    <input name="paySucc" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">支付成功时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="paySuccTime" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">三方支付通道订单id：</label>
                <div class="col-sm-8">
                    <input name="pay3rdOrderNo" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">回调通知是否成功：</label>
                <div class="col-sm-8">
                    <input name="notifySucc" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">回调成功通知时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="notifySuccTime" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">平台收取的费用。单位分：</label>
                <div class="col-sm-8">
                    <input name="platformFee" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">订单有效时间。超过该时间订单无效：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="validTime" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">订单请求ip：</label>
                <div class="col-sm-8">
                    <input name="orderIp" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">通道支付结果消息：</label>
                <div class="col-sm-8">
                    <input name="channelPayResult" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">是否人工补单。默认0否：</label>
                <div class="col-sm-8">
                    <input name="manualSucc" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">最近访问支付地址的ip：</label>
                <div class="col-sm-8">
                    <input name="payurlLastseeIp" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">生成付款二维码是否需要设置备注。：</label>
                <div class="col-sm-8">
                    <input name="needSetMark" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">下游订单号：</label>
                <div class="col-sm-8">
                    <input name="customOrderNo" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">京东买手号：</label>
                <div class="col-sm-8">
                    <input name="jdBuyerId" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">通道费率：</label>
                <div class="col-sm-8">
                    <input name="channelRate" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">：</label>
                <div class="col-sm-8">
                    <input name="bankName" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">：</label>
                <div class="col-sm-8">
                    <input name="proxyIp" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">：</label>
                <div class="col-sm-8">
                    <input name="createUser" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">：</label>
                <div class="col-sm-8">
                    <input name="updateUser" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <th:block th:include="include :: summernote-js" />
    <script th:inline="javascript">
        var prefix = ctx + "business/orderInfo"
        $("#form-orderInfo-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-orderInfo-add').serialize());
            }
        }

        $("input[name='qrcodeTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='paySuccTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='notifySuccTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='validTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $(function() {
            $('.summernote').summernote({
                lang: 'zh-CN',
                dialogsInBody: true,
                callbacks: {
                    onChange: function(contents, $edittable) {
                        $("input[name='" + this.id + "']").val(contents);
                    },
                    onImageUpload: function(files) {
                        var obj = this;
                    	var data = new FormData();
                    	data.append("file", files[0]);
                    	$.ajax({
                            type: "post",
                            url: ctx + "common/upload",
                    		data: data,
                    		cache: false,
                    		contentType: false,
                    		processData: false,
                    		dataType: 'json',
                    		success: function(result) {
                    		    if (result.code == web_status.SUCCESS) {
                    		        $('#' + obj.id).summernote('insertImage', result.url);
                    		    } else {
                    		        $.modal.alertError(result.msg);
                    		    }
                    		},
                    		error: function(error) {
                    		    $.modal.alertWarning("图片上传失败。");
                    		}
                    	});
                    }
                }
            });
        });
    </script>
</body>
</html>